#coding:utf-8
""" Need Pyyaml: http://pyyaml.org/
    this format should be:
        func1:
            -
            arg1: obj1
            arg2: obj2
            -
            arg1: obj3
            arg2: obj4
        func2:
            -
            arg1: obj1
            arg2: obj2
    this list token '-' can not be omitted if you need set more than one
    set of data.
"""

import yaml
import error

def parse_yaml_data(path):
    f = file(path, 'r')
    try:
        data = yaml.load(f)
    except:
        raise error.ParserError("Yaml parser error: %s[%s]"%(path, error.last_error_message()))
    finally:
        f.close()
    return data